package com.TetrisII.voice;
import java.applet.Applet;
import java.applet.AudioClip;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
/**
 * 添加背景音乐和声音特效
 * @author Administrator
 *
 */
public class ShapeVoice {
	
	private AudioClip  backGroundMusic;
	public ShapeVoice(){
		
		File delectVoice=new File("背景.wav");
		
	try {
		backGroundMusic=Applet.newAudioClip(delectVoice.toURL());
	    
	} catch (MalformedURLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	}
	/**
	 * 背景声音
	 */
	public void backGroundVoice(){
		//play()方法为播放一次
		System.out.println("好");
		backGroundMusic.loop();

	}

	
}
